import {
	hexMD5
} from "./md5";
export const codeParams = (params) => {
	if (!params || typeof params !== 'object') {
		params = {}
	}
	const timestamp = Math.round(Date.now() / 1000)
	const apiKey = 'YW5uaWVraWRzQXBp'
	const signature = hexMD5(`apiKey=${apiKey}&timestamp=${timestamp}`)
	const encodedParams = Base64.encode(JSON.stringify(params))
	const yshParam = encodedParams + apiKey

	return {
		timestamp,
		signature,
		yshParam,
	}
}